package windbell.domain.risk.impl;

import edu.fudan.langlab.domain.code.impl.CodeImpl;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import windbell.domain.risk.RiskFixType;
import windbell.domain.risk.proxy.RiskFixTypeProxy;

@Entity
@DiscriminatorValue("RISKFIXTYPE_TYPE")
public class RiskFixTypeImpl extends CodeImpl implements RiskFixType {
  public RiskFixTypeImpl() {
    super();
  }
  
  public static RiskFixType create(final IObjectFactory objectFactory) {
    windbell.domain.risk.RiskFixType riskFixType = new windbell.domain.risk.impl.RiskFixTypeImpl(
    );
    objectFactory.create(riskFixType);
    return riskFixType;			
    
  }
  
  public static RiskFixType createRiskFixTypeImpl(final IObjectFactory objectFactory, final Procedure1<RiskFixType> init) {
    windbell.domain.risk.RiskFixType riskFixType = new windbell.domain.risk.impl.RiskFixTypeImpl(
    );
    objectFactory.create(riskFixType);
    init.apply(riskFixType);
    return riskFixType;			
    
  }
  
  public RiskFixTypeProxy toProxy() {
    windbell.domain.risk.proxy.RiskFixTypeProxy proxy = new windbell.domain.risk.proxy.RiskFixTypeProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
